//
//  CatogryAllSpecialCell.m
//  project
//
//  Created by lanou on 15/10/27.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "CatogryAllSpecialCell.h"
#import <UIImageView+WebCache.h>

@implementation CatogryAllSpecialCell

- (void)awakeFromNib {
    // Initialization code
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        _allSpecialImage = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, kWidth - 10, 140)];
        _allSpecialImage.backgroundColor = [UIColor grayColor];
        [self.contentView addSubview:_allSpecialImage];
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(30, 40, kWidth - 70, 20)];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.textColor = [UIColor whiteColor];
        [_allSpecialImage addSubview:_titleLabel];
        
        _separationImage1 = [[UIImageView alloc]initWithFrame:CGRectMake(30, 70, (kWidth - 80) / 2, 0.5)];
        _separationImage1.backgroundColor = [UIColor whiteColor];
        [_allSpecialImage addSubview:_separationImage1];
        
        _separationImage2 = [[UIImageView alloc]initWithFrame:CGRectMake((kWidth - 80) / 2 + 45, 70, (kWidth - 80) / 2, 0.5)];
        _separationImage2.backgroundColor = [UIColor whiteColor];
        [_allSpecialImage addSubview:_separationImage2];
        
        _fullLabel = [[UILabel alloc]initWithFrame:CGRectMake((kWidth - 80) / 2 + 38, 70, 3, 3)];
        _fullLabel.textAlignment = NSTextAlignmentCenter;
        _fullLabel.font = [UIFont systemFontOfSize:20];
        _fullLabel.text = @"。";
        _fullLabel.textColor = [UIColor whiteColor];
        [_allSpecialImage addSubview:_fullLabel];
        
        _detailLabel = [[UILabel alloc]initWithFrame:CGRectMake(30, 80, kWidth - 70, 20)];
        _detailLabel.font = [UIFont systemFontOfSize:12];
        _detailLabel.textAlignment = NSTextAlignmentCenter;
        _detailLabel.textColor = [UIColor whiteColor];
        [_allSpecialImage addSubview:_detailLabel];
        
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setModel:(CatogryAllSpecialModel *)model
{
    _model = model;
    [_allSpecialImage sd_setImageWithURL:[NSURL URLWithString:model.cover_image_url]];
    _titleLabel.text = model.title;
    _detailLabel.text = model.subtitle;
}

@end
